package cn.cs.service;

import cn.cs.mapper.RepairComplaintMapper;
import cn.cs.mapper.ShopMapper;
import cn.cs.pojo.RepairComplaint;
import cn.cs.pojo.RepairComplaintNode;
import cn.cs.pojo.Shop;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@RestController
public class ShopService {

    @Resource
    private ShopMapper shopMapper;

    @RequestMapping(value = "/getShopList", method = RequestMethod.POST)
    public List<Shop> getShopList(@RequestBody Map<String, Object> param)throws Exception{
        return shopMapper.getShopList(param);
    }

    @RequestMapping(value = "/getShopById", method = RequestMethod.POST)
    public Shop getShopById(@RequestParam("id") Long id)throws Exception{
        return shopMapper.getShopById(id);
    }

    @RequestMapping(value = "/getShopListByMap", method = RequestMethod.POST)
    public List<Shop>	getShopListByMap(@RequestBody Map<String, Object> param)throws Exception{
        return shopMapper.getShopListByMap(param);
    }

    @RequestMapping(value = "/getShopCountByMap", method = RequestMethod.POST)
    public Integer getShopCountByMap(@RequestBody Map<String, Object> param)throws Exception{
        return shopMapper.getShopCountByMap(param);
    }

    @RequestMapping(value = "/getShopNumberByAgentCode", method = RequestMethod.POST)
    public Long getShopNumberByAgentCode(@RequestParam("invitationCode") String invitationCode) throws Exception{
        return shopMapper.getShopNumberByAgentCode(invitationCode);
    }

}
